package com.fand.platform.configuration.dao;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import lombok.val;

import org.apache.commons.lang3.StringUtils;

import com.fand.dto.PaginationDto;
import com.fand.persistent.builder.ModelArgs;
import com.fand.persistent.builder.ModelBuilder;
import com.fand.persistent.builder.ModelBuilderUtils;
import com.fand.persistent.support.DaoJdbcSupport;
import com.fand.platform.configuration.dto.SiteDto;
import com.fand.platform.configuration.dto.SiteLoDto;
import com.fand.platform.configuration.dto.SiteDeDto;
import com.fand.platform.configuration.dto.SiteDeLoDto;
import com.fand.platform.configuration.dto.DomainNaDto;
import com.fand.platform.configuration.dto.DomainNaLoDto;

/**
 * 站
 *
 * @author yaoHT
 * 
 */
public class SiteJdbcDao extends DaoJdbcSupport implements SiteDao {

	@Override
	public int insertSiteBy1(SiteDto insertSite, String... insertProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(ModelBuilder.INSERT,
				insertSite, insertProperties));
		return this.update("configuration/site/insertSiteBy1", modelBuilder.build());
	}

	@Override
	public int insertSiteBy1_1(SiteDto insertSite) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(ModelBuilder.INSERT,
				insertSite));
				
		return this.update("configuration/site/insertSiteBy1", modelBuilder.build());
	}

	@Override
	public int insertSiteBy2(SiteDto insertSite) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(ModelBuilder.INSERT,
				insertSite));

		return this.update("configuration/site/insertSiteBy2", modelBuilder.build());
	}

	@Override
	public int deleteSiteBy1(SiteDto deleteSite, String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(deleteSite,
				whereEqProperties));

		return this.update("configuration/site/deleteSiteBy1", modelBuilder.build());
	}
	@Override
	public int deleteSiteBy1_1(SiteDto deleteSite) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(deleteSite));

		return this.update("configuration/site/deleteSiteBy1", modelBuilder.build());
	}
	
	@Override
	public int deleteSiteByIds(SiteDto deleteSite) {
		val model = new HashMap<String, Object>();

		model.put("IDS", deleteSite.getIds());

		return this.update("configuration/site/deleteSiteByIds", model);
	}

	@Override
	public int updateSiteBy1(SiteDto updateSite, String[] updateProperties, String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(ModelBuilder.UPDATE,
				updateSite, updateProperties), new ModelArgs(updateSite, whereEqProperties));

		return this.update("configuration/site/updateSiteBy1", modelBuilder.build());
	}

	@Override
	public int updateSiteBy1_1(SiteDto updateSite) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(updateSite));

		return this.update("configuration/site/updateSiteBy1", modelBuilder.build());
	}
	
	@Override
	public int updateSiteBy2(SiteDto updateSite) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(updateSite));

		return this.update("configuration/site/updateSiteBy2", modelBuilder.build());
	}

	@Override
	public <R> R selectSiteBy1ForObject(Class<R> requiredType, SiteDto selectSite, String objectId,
			String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectSite,
				whereEqProperties));

		return this.selectForObject(requiredType, "configuration/site/selectSiteBy1ForObject", objectId,
				modelBuilder.build());
	}

	@Override
	public <R> R selectSiteBy1_1ForObject(Class<R> requiredType, SiteDto selectSite, String objectId) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectSite));

		return this.selectForObject(requiredType, "configuration/site/selectSiteBy1ForObject", objectId,
				modelBuilder.build());
	}

	@Override
	public <R> R selectSiteBy2ForObject(Class<R> requiredType, SiteDto selectSite, String objectId) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectSite));

		return this.selectForObject(requiredType, "configuration/site/selectSiteBy2ForObject", objectId,
				modelBuilder.build());
	}

	@Override
	public <R> List<R> selectSiteBy1ForObjectList(Class<R> requiredType, SiteDto selectSite, String objectId,
			String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectSite,
				whereEqProperties));

		return this.selectForObjectList(requiredType, "configuration/site/selectSiteBy1ForObject", objectId,
				modelBuilder.build());
	}

	@Override
	public <R> List<R> selectSiteBy1_1ForObjectList(Class<R> requiredType, SiteDto selectSite, String objectId) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectSite));

		return this.selectForObjectList(requiredType, "configuration/site/selectSiteBy1ForObject", objectId,
				modelBuilder.build());
	}

	@Override
	public <R> List<R> selectSiteBy2ForObjectList(Class<R> requiredType, SiteDto selectSite, String objectId) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectSite));

		return this.selectForObjectList(requiredType, "configuration/site/selectSiteBy2ForObject", objectId,
				modelBuilder.build());
	}

	@Override
	public <R> R selectSiteBy1ForMappedObject(Class<R> mappedClass, SiteDto selectSite,
			String[] selectProperties, String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectSite,
				whereEqProperties));

		modelBuilder.putTrueExtend(ModelBuilder.SELECT, selectProperties);

		return this.selectForMappedObject(mappedClass, "configuration/site/selectSiteBy1ForMappedObjectList",
				modelBuilder.build());
	}

	@Override
	public <R> R selectSiteBy1_1ForMappedObject(Class<R> mappedClass, SiteDto selectSite) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectSite));

		return this.selectForMappedObject(mappedClass, "configuration/site/selectSiteBy1ForMappedObjectList",
				modelBuilder.build());
	}

	@Override
	public <R> R selectSiteBy2ForMappedObject(Class<R> mappedClass, SiteDto selectSite) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectSite));

		return this.selectForMappedObject(mappedClass, "configuration/site/selectSiteBy2ForMappedObjectList",
				modelBuilder.build());
	}

	@Override
	public int selectSiteByCodeNqIdForInteger(SiteDto selectSite) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder();

//		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder().putExtend(null, "code", null,
//				selectSite.getCode());

//		if (StringUtils.isNotBlank(selectSite.getId())) {
//			modelBuilder.putExtend(ModelBuilder.WHERE__AND__NQ, "id", null, selectSite.getId());
//		}

		return this.selectForObject(Integer.class, "configuration/site/selectSiteBy1ForObject", null,
				modelBuilder.build());
	}

	@Override
	public <R> List<R> selectSiteBy1ForMappedObjectList(Class<R> mappedClass, SiteDto selectSite,
			String[] selectProperties, String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectSite,
				whereEqProperties));

		modelBuilder.putTrueExtend(ModelBuilder.SELECT, selectProperties);

		return this.selectForMappedObjectList(mappedClass, "configuration/site/selectSiteBy1ForMappedObjectList",
				modelBuilder.build());
	}

	@Override
	public <R> List<R> selectSiteBy1_1ForMappedObjectList(Class<R> mappedClass, SiteDto selectSite) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectSite));

		return this.selectForMappedObjectList(mappedClass, "configuration/site/selectSiteBy1ForMappedObjectList",
				modelBuilder.build());
	}

	@Override
	public <R> List<R> selectSiteBy2ForMappedObjectList(Class<R> mappedClass, SiteDto selectSite) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectSite));

		return this.selectForMappedObjectList(mappedClass, "configuration/site/selectSiteBy2ForMappedObjectList",
				modelBuilder.build());
	}

	@Override
	public <R> PaginationDto<R> paginationSiteBy1ForMappedObjectList(Class<R> mappedClass,
				SiteDto paginationSite) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(paginationSite));

		return this.paginationForMappedObjectList(mappedClass, "configuration/site/selectSiteBy1ForObject",
				"configuration/site/selectSiteBy1ForMappedObjectList",
				paginationSite.getPaginationNo(),
				paginationSite.getPaginationSize(),
				modelBuilder.build());
	}

	@Override
	public PaginationDto<Map<String, Object>> paginationSiteBy1ForMapList(SiteDto paginationSite) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(paginationSite));

		return this.paginationForMapList("configuration/site/selectSiteBy1ForObject",
				"configuration/site/selectSiteBy1ForMappedObjectList",
				paginationSite.getPaginationNo(),
				paginationSite.getPaginationSize(),
				modelBuilder.build());
	}

	@Override
	public int insertSiteLoBy1(SiteLoDto insertSiteLo, String... insertProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(ModelBuilder.INSERT,
				insertSiteLo, insertProperties));
		return this.update("configuration/siteLo/insertSiteLoBy1", modelBuilder.build());
	}

	@Override
	public int deleteSiteLoBy1(SiteLoDto deleteSiteLo, String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(deleteSiteLo,
				whereEqProperties));

		return this.update("configuration/siteLo/deleteSiteLoBy1", modelBuilder.build());
	}

	@Override
	public int updateSiteLoBy1(SiteLoDto updateSiteLo, String[] updateProperties, String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(ModelBuilder.UPDATE,
				updateSiteLo, updateProperties), new ModelArgs(updateSiteLo, whereEqProperties));

		return this.update("configuration/siteLo/updateSiteLoBy1", modelBuilder.build());
	}

	@Override
	public <R> R selectSiteLoBy1ForObject(Class<R> requiredType, SiteLoDto selectSiteLo, String objectId,
			String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectSiteLo,
				whereEqProperties));

		return this.selectForObject(requiredType, "configuration/siteLo/selectSiteLoBy1ForObject", objectId,
				modelBuilder.build());
	}

	@Override
	public <R> List<R> selectSiteLoBy1ForObjectList(Class<R> requiredType, SiteLoDto selectSiteLo, String objectId,
			String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectSiteLo,
				whereEqProperties));

		return this.selectForObjectList(requiredType, "configuration/siteLo/selectSiteLoBy1ForObject", objectId,
				modelBuilder.build());
	}

	@Override
	public <R> R selectSiteLoBy1ForMappedObject(Class<R> mappedClass, SiteLoDto selectSiteLo,
			String[] selectProperties, String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectSiteLo,
				whereEqProperties));

		modelBuilder.putTrueExtend(ModelBuilder.SELECT, selectProperties);

		return this.selectForMappedObject(mappedClass, "configuration/siteLo/selectSiteLoBy1ForMappedObjectList",
				modelBuilder.build());
	}

	@Override
	public <R> List<R> selectSiteLoBy1ForMappedObjectList(Class<R> mappedClass, SiteLoDto selectSiteLo,
			String[] selectProperties, String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectSiteLo,
				whereEqProperties));

		modelBuilder.putTrueExtend(ModelBuilder.SELECT, selectProperties);

		return this.selectForMappedObjectList(mappedClass, "configuration/siteLo/selectSiteLoBy1ForMappedObjectList",
				modelBuilder.build());
	}

	@Override
	public int insertSiteDeBy1(SiteDeDto insertSiteDe, String... insertProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(ModelBuilder.INSERT,
				insertSiteDe, insertProperties));
		return this.update("configuration/siteDe/insertSiteDeBy1", modelBuilder.build());
	}

	@Override
	public int deleteSiteDeBy1(SiteDeDto deleteSiteDe, String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(deleteSiteDe,
				whereEqProperties));

		return this.update("configuration/siteDe/deleteSiteDeBy1", modelBuilder.build());
	}

	@Override
	public int updateSiteDeBy1(SiteDeDto updateSiteDe, String[] updateProperties, String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(ModelBuilder.UPDATE,
				updateSiteDe, updateProperties), new ModelArgs(updateSiteDe, whereEqProperties));

		return this.update("configuration/siteDe/updateSiteDeBy1", modelBuilder.build());
	}

	@Override
	public <R> R selectSiteDeBy1ForObject(Class<R> requiredType, SiteDeDto selectSiteDe, String objectId,
			String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectSiteDe,
				whereEqProperties));

		return this.selectForObject(requiredType, "configuration/siteDe/selectSiteDeBy1ForObject", objectId,
				modelBuilder.build());
	}

	@Override
	public <R> List<R> selectSiteDeBy1ForObjectList(Class<R> requiredType, SiteDeDto selectSiteDe, String objectId,
			String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectSiteDe,
				whereEqProperties));

		return this.selectForObjectList(requiredType, "configuration/siteDe/selectSiteDeBy1ForObject", objectId,
				modelBuilder.build());
	}

	@Override
	public <R> R selectSiteDeBy1ForMappedObject(Class<R> mappedClass, SiteDeDto selectSiteDe,
			String[] selectProperties, String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectSiteDe,
				whereEqProperties));

		modelBuilder.putTrueExtend(ModelBuilder.SELECT, selectProperties);

		return this.selectForMappedObject(mappedClass, "configuration/siteDe/selectSiteDeBy1ForMappedObjectList",
				modelBuilder.build());
	}

	@Override
	public <R> List<R> selectSiteDeBy1ForMappedObjectList(Class<R> mappedClass, SiteDeDto selectSiteDe,
			String[] selectProperties, String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectSiteDe,
				whereEqProperties));

		modelBuilder.putTrueExtend(ModelBuilder.SELECT, selectProperties);

		return this.selectForMappedObjectList(mappedClass, "configuration/siteDe/selectSiteDeBy1ForMappedObjectList",
				modelBuilder.build());
	}

	@Override
	public int insertSiteDeLoBy1(SiteDeLoDto insertSiteDeLo, String... insertProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(ModelBuilder.INSERT,
				insertSiteDeLo, insertProperties));
		return this.update("configuration/siteDeLo/insertSiteDeLoBy1", modelBuilder.build());
	}

	@Override
	public int deleteSiteDeLoBy1(SiteDeLoDto deleteSiteDeLo, String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(deleteSiteDeLo,
				whereEqProperties));

		return this.update("configuration/siteDeLo/deleteSiteDeLoBy1", modelBuilder.build());
	}

	@Override
	public int updateSiteDeLoBy1(SiteDeLoDto updateSiteDeLo, String[] updateProperties, String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(ModelBuilder.UPDATE,
				updateSiteDeLo, updateProperties), new ModelArgs(updateSiteDeLo, whereEqProperties));

		return this.update("configuration/siteDeLo/updateSiteDeLoBy1", modelBuilder.build());
	}

	@Override
	public <R> R selectSiteDeLoBy1ForObject(Class<R> requiredType, SiteDeLoDto selectSiteDeLo, String objectId,
			String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectSiteDeLo,
				whereEqProperties));

		return this.selectForObject(requiredType, "configuration/siteDeLo/selectSiteDeLoBy1ForObject", objectId,
				modelBuilder.build());
	}

	@Override
	public <R> List<R> selectSiteDeLoBy1ForObjectList(Class<R> requiredType, SiteDeLoDto selectSiteDeLo, String objectId,
			String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectSiteDeLo,
				whereEqProperties));

		return this.selectForObjectList(requiredType, "configuration/siteDeLo/selectSiteDeLoBy1ForObject", objectId,
				modelBuilder.build());
	}

	@Override
	public <R> R selectSiteDeLoBy1ForMappedObject(Class<R> mappedClass, SiteDeLoDto selectSiteDeLo,
			String[] selectProperties, String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectSiteDeLo,
				whereEqProperties));

		modelBuilder.putTrueExtend(ModelBuilder.SELECT, selectProperties);

		return this.selectForMappedObject(mappedClass, "configuration/siteDeLo/selectSiteDeLoBy1ForMappedObjectList",
				modelBuilder.build());
	}

	@Override
	public <R> List<R> selectSiteDeLoBy1ForMappedObjectList(Class<R> mappedClass, SiteDeLoDto selectSiteDeLo,
			String[] selectProperties, String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectSiteDeLo,
				whereEqProperties));

		modelBuilder.putTrueExtend(ModelBuilder.SELECT, selectProperties);

		return this.selectForMappedObjectList(mappedClass, "configuration/siteDeLo/selectSiteDeLoBy1ForMappedObjectList",
				modelBuilder.build());
	}

	@Override
	public int insertDomainNaBy1(DomainNaDto insertDomainNa, String... insertProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(ModelBuilder.INSERT,
				insertDomainNa, insertProperties));
		return this.update("configuration/domainNa/insertDomainNaBy1", modelBuilder.build());
	}

	@Override
	public int insertDomainNaBy1_1(DomainNaDto insertDomainNa) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(ModelBuilder.INSERT,
				insertDomainNa));
				
		return this.update("configuration/domainNa/insertDomainNaBy1", modelBuilder.build());
	}

	@Override
	public int insertDomainNaBy2(DomainNaDto insertDomainNa) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(ModelBuilder.INSERT,
				insertDomainNa));

		return this.update("configuration/domainNa/insertDomainNaBy2", modelBuilder.build());
	}

	@Override
	public int deleteDomainNaBy1(DomainNaDto deleteDomainNa, String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(deleteDomainNa,
				whereEqProperties));

		return this.update("configuration/domainNa/deleteDomainNaBy1", modelBuilder.build());
	}
	@Override
	public int deleteDomainNaBy1_1(DomainNaDto deleteDomainNa) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(deleteDomainNa));

		return this.update("configuration/domainNa/deleteDomainNaBy1", modelBuilder.build());
	}
	
	@Override
	public int deleteDomainNaByIds(DomainNaDto deleteDomainNa) {
		val model = new HashMap<String, Object>();

		model.put("IDS", deleteDomainNa.getIds());

		return this.update("configuration/domainNa/deleteDomainNaByIds", model);
	}

	@Override
	public int updateDomainNaBy1(DomainNaDto updateDomainNa, String[] updateProperties, String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(ModelBuilder.UPDATE,
				updateDomainNa, updateProperties), new ModelArgs(updateDomainNa, whereEqProperties));

		return this.update("configuration/domainNa/updateDomainNaBy1", modelBuilder.build());
	}

	@Override
	public int updateDomainNaBy1_1(DomainNaDto updateDomainNa) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(updateDomainNa));

		return this.update("configuration/domainNa/updateDomainNaBy1", modelBuilder.build());
	}
	
	@Override
	public int updateDomainNaBy2(DomainNaDto updateDomainNa) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(updateDomainNa));

		return this.update("configuration/domainNa/updateDomainNaBy2", modelBuilder.build());
	}

	@Override
	public <R> R selectDomainNaBy1ForObject(Class<R> requiredType, DomainNaDto selectDomainNa, String objectId,
			String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectDomainNa,
				whereEqProperties));

		return this.selectForObject(requiredType, "configuration/domainNa/selectDomainNaBy1ForObject", objectId,
				modelBuilder.build());
	}

	@Override
	public <R> R selectDomainNaBy1_1ForObject(Class<R> requiredType, DomainNaDto selectDomainNa, String objectId) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectDomainNa));

		return this.selectForObject(requiredType, "configuration/domainNa/selectDomainNaBy1ForObject", objectId,
				modelBuilder.build());
	}

	@Override
	public <R> R selectDomainNaBy2ForObject(Class<R> requiredType, DomainNaDto selectDomainNa, String objectId) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectDomainNa));

		return this.selectForObject(requiredType, "configuration/domainNa/selectDomainNaBy2ForObject", objectId,
				modelBuilder.build());
	}

	@Override
	public <R> List<R> selectDomainNaBy1ForObjectList(Class<R> requiredType, DomainNaDto selectDomainNa, String objectId,
			String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectDomainNa,
				whereEqProperties));

		return this.selectForObjectList(requiredType, "configuration/domainNa/selectDomainNaBy1ForObject", objectId,
				modelBuilder.build());
	}

	@Override
	public <R> List<R> selectDomainNaBy1_1ForObjectList(Class<R> requiredType, DomainNaDto selectDomainNa, String objectId) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectDomainNa));

		return this.selectForObjectList(requiredType, "configuration/domainNa/selectDomainNaBy1ForObject", objectId,
				modelBuilder.build());
	}

	@Override
	public <R> List<R> selectDomainNaBy2ForObjectList(Class<R> requiredType, DomainNaDto selectDomainNa, String objectId) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectDomainNa));

		return this.selectForObjectList(requiredType, "configuration/domainNa/selectDomainNaBy2ForObject", objectId,
				modelBuilder.build());
	}

	@Override
	public <R> R selectDomainNaBy1ForMappedObject(Class<R> mappedClass, DomainNaDto selectDomainNa,
			String[] selectProperties, String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectDomainNa,
				whereEqProperties));

		modelBuilder.putTrueExtend(ModelBuilder.SELECT, selectProperties);

		return this.selectForMappedObject(mappedClass, "configuration/domainNa/selectDomainNaBy1ForMappedObjectList",
				modelBuilder.build());
	}

	@Override
	public <R> R selectDomainNaBy1_1ForMappedObject(Class<R> mappedClass, DomainNaDto selectDomainNa) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectDomainNa));

		return this.selectForMappedObject(mappedClass, "configuration/domainNa/selectDomainNaBy1ForMappedObjectList",
				modelBuilder.build());
	}

	@Override
	public <R> R selectDomainNaBy2ForMappedObject(Class<R> mappedClass, DomainNaDto selectDomainNa) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectDomainNa));

		return this.selectForMappedObject(mappedClass, "configuration/domainNa/selectDomainNaBy2ForMappedObjectList",
				modelBuilder.build());
	}

	@Override
	public int selectDomainNaByCodeNqIdForInteger(DomainNaDto selectDomainNa) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder();

//		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder().putExtend(null, "code", null,
//				selectDomainNa.getCode());

//		if (StringUtils.isNotBlank(selectDomainNa.getId())) {
//			modelBuilder.putExtend(ModelBuilder.WHERE__AND__NQ, "id", null, selectDomainNa.getId());
//		}

		return this.selectForObject(Integer.class, "configuration/domainNa/selectDomainNaBy1ForObject", null,
				modelBuilder.build());
	}

	@Override
	public <R> List<R> selectDomainNaBy1ForMappedObjectList(Class<R> mappedClass, DomainNaDto selectDomainNa,
			String[] selectProperties, String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectDomainNa,
				whereEqProperties));

		modelBuilder.putTrueExtend(ModelBuilder.SELECT, selectProperties);

		return this.selectForMappedObjectList(mappedClass, "configuration/domainNa/selectDomainNaBy1ForMappedObjectList",
				modelBuilder.build());
	}

	@Override
	public <R> List<R> selectDomainNaBy1_1ForMappedObjectList(Class<R> mappedClass, DomainNaDto selectDomainNa) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectDomainNa));

		return this.selectForMappedObjectList(mappedClass, "configuration/domainNa/selectDomainNaBy1ForMappedObjectList",
				modelBuilder.build());
	}

	@Override
	public <R> List<R> selectDomainNaBy2ForMappedObjectList(Class<R> mappedClass, DomainNaDto selectDomainNa) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectDomainNa));

		return this.selectForMappedObjectList(mappedClass, "configuration/domainNa/selectDomainNaBy2ForMappedObjectList",
				modelBuilder.build());
	}

	@Override
	public <R> PaginationDto<R> paginationDomainNaBy1ForMappedObjectList(Class<R> mappedClass,
				DomainNaDto paginationDomainNa) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(paginationDomainNa));

		return this.paginationForMappedObjectList(mappedClass, "configuration/domainNa/selectDomainNaBy1ForObject",
				"configuration/domainNa/selectDomainNaBy1ForMappedObjectList",
				paginationDomainNa.getPaginationNo(),
				paginationDomainNa.getPaginationSize(),
				modelBuilder.build());
	}

	@Override
	public PaginationDto<Map<String, Object>> paginationDomainNaBy1ForMapList(DomainNaDto paginationDomainNa) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(paginationDomainNa));

		return this.paginationForMapList("configuration/domainNa/selectDomainNaBy1ForObject",
				"configuration/domainNa/selectDomainNaBy1ForMappedObjectList",
				paginationDomainNa.getPaginationNo(),
				paginationDomainNa.getPaginationSize(),
				modelBuilder.build());
	}

	@Override
	public int insertDomainNaLoBy1(DomainNaLoDto insertDomainNaLo, String... insertProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(ModelBuilder.INSERT,
				insertDomainNaLo, insertProperties));
		return this.update("configuration/domainNaLo/insertDomainNaLoBy1", modelBuilder.build());
	}

	@Override
	public int deleteDomainNaLoBy1(DomainNaLoDto deleteDomainNaLo, String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(deleteDomainNaLo,
				whereEqProperties));

		return this.update("configuration/domainNaLo/deleteDomainNaLoBy1", modelBuilder.build());
	}

	@Override
	public int updateDomainNaLoBy1(DomainNaLoDto updateDomainNaLo, String[] updateProperties, String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(ModelBuilder.UPDATE,
				updateDomainNaLo, updateProperties), new ModelArgs(updateDomainNaLo, whereEqProperties));

		return this.update("configuration/domainNaLo/updateDomainNaLoBy1", modelBuilder.build());
	}

	@Override
	public <R> R selectDomainNaLoBy1ForObject(Class<R> requiredType, DomainNaLoDto selectDomainNaLo, String objectId,
			String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectDomainNaLo,
				whereEqProperties));

		return this.selectForObject(requiredType, "configuration/domainNaLo/selectDomainNaLoBy1ForObject", objectId,
				modelBuilder.build());
	}

	@Override
	public <R> List<R> selectDomainNaLoBy1ForObjectList(Class<R> requiredType, DomainNaLoDto selectDomainNaLo, String objectId,
			String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectDomainNaLo,
				whereEqProperties));

		return this.selectForObjectList(requiredType, "configuration/domainNaLo/selectDomainNaLoBy1ForObject", objectId,
				modelBuilder.build());
	}

	@Override
	public <R> R selectDomainNaLoBy1ForMappedObject(Class<R> mappedClass, DomainNaLoDto selectDomainNaLo,
			String[] selectProperties, String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectDomainNaLo,
				whereEqProperties));

		modelBuilder.putTrueExtend(ModelBuilder.SELECT, selectProperties);

		return this.selectForMappedObject(mappedClass, "configuration/domainNaLo/selectDomainNaLoBy1ForMappedObjectList",
				modelBuilder.build());
	}

	@Override
	public <R> List<R> selectDomainNaLoBy1ForMappedObjectList(Class<R> mappedClass, DomainNaLoDto selectDomainNaLo,
			String[] selectProperties, String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectDomainNaLo,
				whereEqProperties));

		modelBuilder.putTrueExtend(ModelBuilder.SELECT, selectProperties);

		return this.selectForMappedObjectList(mappedClass, "configuration/domainNaLo/selectDomainNaLoBy1ForMappedObjectList",
				modelBuilder.build());
	}
}